<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>无标题文档</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
    <script type="text/javascript" th:src="@{/js/jquery.js}"></script>
</head>

<body>
<div class="place"><span>位置：</span>
    <ul class="placeul">
        <li>数据统计</li>
        <li>入库统计</li>
        <li>入库详情</li>
    </ul>
</div>
<div class="rightinfo">
    <form th:action="@{/rkWarehouse/rkDetails}" method="post" id="rkDetailsForm">
        <input type="hidden" id="pageNum" name="pageNum" value="1">
        <input type="hidden" id="cName" name="cName" th:value="${cName}">
        <table class="tablelist">
            <thead>
            <tr>
                <th>序号</th>
                <th>仓库名称</th>
                <th>采购单编号</th>
                <th>商品数量</th>
                <th>金额</th>
                <th>入库时间</th>
                <th>入库人</th>
                <th>采购单详情</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="rk,i:${rkDetails.list}">
                <td th:text="${(rkDetails.pageNum-1)*rkDetails.pageSize+i.count}">1</td>
                <td th:text="${rk.warehouse2.cName}">南京21号仓库</td>
                <td th:text="${rk.rkIndent}">CG201701270001</td>
                <td th:text="${rk.cDetails.count}">5</td>
                <td th:text="${rk.cDetails.totalMoney}">￥76,582</td>
                <td th:text="${#dates.format(rk.rkDate,'yyyy-MM-dd')}">2017-01-25 15:05:05</td>
                <td th:text="${rk.rkUsers.uname}">马云</td>
                <td>
                    <a th:href="@{/purchase/RkDetails?purchaseId=}+${rk.rkIndent}" class="tablelink">查看详情</a>
                </td>
            </tr>
            </tbody>
        </table>
        <div class="pagin">
            <div class="message">
                共<i class="blue" th:text="${rkDetails.total}">1256</i>条记录，当前显示第&nbsp;<i class="blue"
                                                                                        th:text="${rkDetails.pageNum}">2&nbsp;</i>页
            </div>
            <ul class="paginList">
                <li class="paginItem">
                    <a href="javascript:void(0);"
                       th:onclick="goPage([[${rkDetails.isFirstPage?1:rkDetails.pageNum-1}]])">
                        <span th:class="${rkDetails.isFirstPage?'pagepre':'pagenxt roate'}"></span>
                    </a>
                </li>
                <li th:each="page : ${rkDetails.navigatepageNums}"
                    th:class="${page==rkDetails.pageNum?'paginItem current':'paginItem'}">
                    <a href="javascript:void(0);" th:text="${page}" th:onclick="goPage([[${page}]])">1</a>
                </li>
                <li class="paginItem">
                    <a href="javascript:void(0);"
                       th:onclick="goPage([[${rkDetails.isLastPage?rkDetails.pages:rkDetails.pageNum+1}]])">
                        <span th:class="${rkDetails.isLastPage?'pagepre roate':'pagenxt'}"></span>
                    </a>
                </li>
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');

    // 提交表单
    function goPage(num) {
        //submit提交
        $("#pageNum").val(num);
        $("#rkDetailsForm").submit();
    }
</script>
</body>
</html>
